import Vue from 'vue'
import Router from 'vue-router'
import {lazyLoading} from './lazyLoading'

Vue.use(Router)

export default new Router({
    routes: [
        { path: '/', redirect: 'home-list' },
        { path: '*', redirect: 'home-list' },
        {
            path: '/',
            name: 'home',
            component: lazyLoading('home/home'),
            children:[
                {
                    path: 'home-list',
                    name:'home-list',
                    component: lazyLoading('home/home-list')
                },
                {
                    path:'order',
                    name:'order',
                    component:lazyLoading('order/order')
                },
                {
                    path:'mine',
                    name:'mine',
                    component:lazyLoading('mine/mine')
                }
            ],
        },
        {
          path:'/appointment',
          name:'appointment',
          component:lazyLoading('appointment/time-appointment')
        },
        {
            path:'/alleq',
            name:'alleq',
            component:lazyLoading('allEquipment/all-equipment')
        },
        { path: '/auth', redirect: 'auth/password-login' },
        {
            path: '/auth',
            name: 'auth',
            component: lazyLoading('auth/auth'),
            children:[
                {
                    path: 'password-login',
                    name:'password-login',
                    component: lazyLoading('auth/password-login')
                }
            ],
        }
    ]
})
